﻿<UserControl x:Class="Stats.Plugin.FileCollectionStatsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:y="clr-namespace:WpfImageDuplicates;assembly=WpfImageDuplicates"
             xmlns:vm="clr-namespace:ImageAppViewModels"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d">
    <UserControl.CommandBindings>
        <CommandBinding Command="{x:Static y:GeneralCommands.ClearStatsCommand}" Executed="ClearStats"/>
    </UserControl.CommandBindings>
    <Grid x:Name="grid" Height="Auto" Width="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="22"/>
        </Grid.RowDefinitions>
        <WrapPanel Grid.Row="0" x:Name="stacker" Orientation="Horizontal">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9"  Grid.Column="0" Text="Unused Byte Count:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding UnusedByteCountString}"/>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9"  Grid.Column="0" Text="Thumbs Read from Bytes:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding ThumbsReadFromImageBytes}"/>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9"  Grid.Column="0" Text="Thumbs Read from .thumb:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding ThumbsReadFromDisk}"/>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9"  Grid.Column="0" Text="Total Bytes Read:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding TotalBytesRead}"/>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9"  Grid.Column="0" Text="Drawn Pixls (100,000's):"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding TotalDrawnPixels}"/>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9" Grid.Column="0" Text="Loaded Byte Count:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding LoadedByteCountString}"/>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9" Grid.Column="0" Text="TotalCyclesMissedDueToFileLock:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding TotalCyclesMissedDueToFileLock}"/>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock FontSize="9" Grid.Column="0" Text="Loaded File Count:"/>
                <StackPanel Orientation="Horizontal" Grid.Column="1" >
                    <TextBlock FontSize="9" Text="{Binding LoadedFileCount}"/>
                    <TextBlock FontSize="9" Text=" / "/>
                    <TextBlock FontSize="9" Text="{Binding MaxFilesInMemory}"/>
                </StackPanel>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock FontSize="9" Grid.Column="0" Text="ThumbnailImageSources:"/>
                <StackPanel Orientation="Horizontal" Grid.Column="1" >
                    <TextBlock FontSize="9" Text="{Binding CachedThumbnailImageSources}"/>
                    <TextBlock FontSize="9" Text=" / "/>
                    <TextBlock FontSize="9" Text="NA"/>
                </StackPanel>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock FontSize="9" Grid.Column="0" Text="CachedImageSources:"/>
                <StackPanel Orientation="Horizontal" Grid.Column="1" >
                    <TextBlock FontSize="9" Text="{Binding CachedImageSources}"/>
                    <TextBlock FontSize="9" Text=" / "/>
                    <TextBlock FontSize="9" Text="{Binding MaxCachedImageSources}"/>
                </StackPanel>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock FontSize="9" Grid.Column="0" Text="ImageDrawFailures:"/>
                <StackPanel Orientation="Horizontal" Grid.Column="1" >
                    <TextBlock FontSize="9" Text="{Binding ImageDrawFailures}"/>
                </StackPanel>
            </Grid>

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9" Grid.Column="0" Text="Thumbnails Visible:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding NumberVisible}"/>
            </Grid>

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9" Grid.Column="0" Text="Total Collection Count:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding FileImageCollectionCount}"/>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9" Grid.Column="0" Text="ViewModel Collection Count:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding FileImageViewModelCollectionCount}"/>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>

                <TextBlock  FontSize="9" Grid.Column="0" Text="Loaded Thumbnails:"/>
                <StackPanel Orientation="Horizontal" Grid.Column="1" >
                    <TextBlock  FontSize="9" Text="{Binding LoadedThumbs}"/>
                    <TextBlock FontSize="9" Text=" / "/>
                    <TextBlock FontSize="9" Text="{Binding MaxThumbsInMemory}"/>
                </StackPanel>

            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock FontSize="9" Grid.Column="0" Text="Loaded Bitmaps:"/>
                <StackPanel Orientation="Horizontal" Grid.Column="1" >
                    <TextBlock FontSize="9" Text="{Binding LoadedBitmaps}"/>
                    <TextBlock FontSize="9" Text=" / "/>
                    <TextBlock FontSize="9" Text="{Binding MaxBitmapsInMemory}"/>
                </StackPanel>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock FontSize="9" Grid.Column="0" Text="LoadedAdditionalInfoCount:"/>
                <StackPanel Orientation="Horizontal" Grid.Column="1" >
                    <TextBlock FontSize="9" Text="{Binding LoadedAdditionalInfoCount}"/>
                    <TextBlock FontSize="9" Text=" / "/>
                    <TextBlock FontSize="9" Text="30"/>
                </StackPanel>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9" Grid.Column="0" Text="Average Image Source Time:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding Path=AverageImageSourceTime, StringFormat=N0}"/>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9" Grid.Column="0" Text="Average Filter Time:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding Path=AverageFilterTime, StringFormat=N0}"/>
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9" Grid.Column="0" Text="Average Draw Image Time:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding Path=AverageDrawImageTime, StringFormat=N0}" />
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9" Grid.Column="0" Text="Average Bitmap Load Time:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding Path=AverageThumbLoadTime, StringFormat=N0}" />
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9" Grid.Column="0" Text="CurrentBlurCounter:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding Path=CurrentBlurCounter, StringFormat=N0}" />
            </Grid>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="140"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <TextBlock  FontSize="9" Grid.Column="0" Text="BackgroundCalcCounter:"/>
                <TextBlock  FontSize="9" Grid.Column="1" Text="{Binding Path=BackgroundCalcCounter, StringFormat=N0}" />
            </Grid>
        </WrapPanel>
        <StackPanel Orientation="Horizontal" x:Name="bottomStack" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center">
            <Button x:Name="btnClearStats" FontSize="9" Content="Clear Timing Stats" Command="{x:Static y:GeneralCommands.ClearStatsCommand}" />
        </StackPanel>
    </Grid>
</UserControl>
